/**
 * Created by Lin Hui on 2016/12/13.
 */
+function($){
    $.extend({
        geek:{
            //登录
            login:function(){
                var token = getToken(), form = $('form.ajax-submit');

                $('#getCode').click(function(){
                    $.ajax({
                        url:ThinkPHP.U('Admin/Public/getCodeByLogin'),
                        data:{user_login:$('input[name="user_login"]').val()},
                        type:'post',
                        dataType:'json',
                        success:function(resp){
                            layer.msg(resp.msg);
                        }
                    });
                });
                /*$('.passcode').click(function(){
                    $(this).attr('src', ThinkPHP.U('Admin/Public/verify', 'token='+token+'&v='+Date.now()));
                });

                $('.passcode').trigger('click');

                $('input[name="code"]').blur(function(){
                    var code = $(this);
                    $.getJSON(ThinkPHP.U('Admin/Public/ajaxVerify', 'token='+token+'&code='+code.val()), function(resp){
                        if(resp.status === false){
                            form.attr('data-no-submit', '1');
                            layer.tips(resp.msg, code);
                        } else {
                            form.attr('data-no-submit', '0');
                        }
                    });
                });*/
            }
        }
    });
}(jQuery);